proc
	TelnetInfo(client/C)
		if(!TelnetInfo || !C || (!istype(C) && !istext(C)) || (istype(C) && !(C.ckey in TelnetInfo)) || (istext(C) && !(C in TelnetInfo))) return null
		else return TelnetInfo[(istype(C) ? C.ckey : C)]

	TelnetAuth(uname, pwd)
		if(!uname || !pwd || !istext(uname) || !istext(pwd)) return 0
		var/list/L = TelnetInfo(uname)
		if(!L || pwd != L["pwd"]) return 0
		return list(L["uname"], L["cmd"])

	SetTelnetInfo(client/C, pass, cmd)
		if(!C || !istype(C) || !istext(pass) || !istext(cmd)) return null
		if(!TelnetInfo) TelnetInfo = new
		TelnetInfo[C.ckey] = list("pwd" = pass, "cmd" = cmd, "uname" = C.key)

	TelnetPass(client/C)
		if(!C || !istype(C)) return ""
		var/list/L = TelnetInfo(C)
		if(!L) return ""
		return L["pwd"]

	TelnetCmd(client/C)
		if(!C || !istype(C)) return ""
		var/list/L = TelnetInfo(C)
		if(!L) return ""
		return L["cmd"]